import React, {Component} from 'react';
// import 'react-bootstrap/dist/react-bootstrap';

import Search from "./components/Search";
import List from "./components/List";

class App extends Component {

    //初始化状态，
    state = {
        users:[],//users 初始值为数组
        isFirst:true,//标识是否为第一次搜索
        isLoading:false,//标识是否处于加载中
        err:''//错误信息
    }

    //更新app的state
    updateAppState=(stateObj)=>{
        this.setState(stateObj)
    }

    render() {
        return (
            <div className="container">
                <Search updateAppState={this.updateAppState}/>
               <List {...this.state}/>
            </div>
        );
    }
}

export default App;
